
  
    \admin\components\shop\items.tpl.php

  

<th class="lt_header" align="center" width="65"></th>   

  65  95


 
<a title="  " href="/shop/<?php echo $item['seolink'];?>.html">
                                                <img border="0" hspace="2" alt="  " src="images/actions/search.gif"/>
                                            </a>
                                            
 
 
 <a title="  " href="?view=components&do=config&id=<?php echo $component_id; ?>&opt=get_users&item_id=<?php echo $item['id']; ?>">
  <img border="0" hspace="2" alt="  " src="images/actions/message.gif"/>
 </a>      
 
 
  
      \admin\components\shop\backend.php
      


//=================================================================================================//

    if ($opt == 'copy_cat_chars'){

        $to_cat_id      = $inCore->request('to_cat_id', 'int', 0);
        $from_cat_id    = $inCore->request('from_cat_id', 'int', 0);

        if ($to_cat_id && $from_cat_id){
            $model->copyCatChars($from_cat_id, $to_cat_id);
        }

        $inCore->redirectBack();

    }

//=================================================================================================//


      
  
//=================================================================================================//

    if ($opt == 'get_users'){

   
     	if ($inCore->inRequest('item_id')){
			$id = $inCore->request('item_id', 'int');

     $item = $inDB->get_field('cms_shop_items', "id={$id}", 'title');
      echo '<h3>  ,   &laquo;'.$item.'&raquo;:</h3>'; 

      
  $sql = "SELECT * FROM cms_shop_loads
     WHERE item_id=$id";
         $res = $inDB->query($sql);                            

     if ($inDB->num_rows($res)){
     $baza=array();   
  while($cat = $inDB->fetch_assoc($res)){
   $mail = $inDB->get_fields('cms_shop_orders', "id={$cat[order_id]}", '*');     
     $cat['email'] = $mail['customer_email'];
      $cat['username'] = $mail['customer_name'];
     $baza[] = $cat;
}
 echo '
     <div id="rem">'; echo ':'.$inDB->num_rows($res).'  <br>
	 <table width="605" border="0" cellpadding="10" cellspacing="0" class="proptable" style="border:none">
	 <tr><td><form name="addform" action="" method="post" >
	
	<strong>:</strong><br />
	<input name="mails" type="text" size="67"/ value="';
  foreach ($baza as $emails) { echo $emails['email'].','; }
  echo '"> <br><br /><strong>:</strong><br />
	<input name="sub" type="text" size="67"/>
	<p>	<strong> :</strong><br> (    <b>{}</b>     <br>
   <b>{}</b>    )<br />
  <textarea rows="10" cols="50" name="text"></textarea></p>
  <input name="item" type="hidden" value="'.$item.'" />
  <p><input type="submit" value=""></p> </form>
	</td></tr></table></div>';

}  else { echo '<strong>     !</strong>'; }
                            
  }  else { echo '<strong>  !</strong>';  } 
   echo '<p><a href="index.php?view=components&do=config&id='.$_REQUEST['id'].'&opt=list_items">   </a></p>';  
      }
      
if ($_REQUEST['mails']) {
$message=$_REQUEST['text'];
$message = str_replace("{}", $_REQUEST['item'], $message);
 
 $mails = explode(",", $_REQUEST['mails']);                
	 foreach ($mails as $adresat) {
	   $name = $inDB->get_field('cms_shop_orders', 'customer_email="'.$adresat.'"', 'customer_name');
     $smessage=str_replace("{}", $name, $message);	                    
	if ($adresat){$inCore->mailText($adresat, $_REQUEST['sub'], $smessage); $count++;}    
	    } if ($count){$msg="   ".$count." !"; }
        
   if ($msg){
     echo "<script>document.getElementById('rem').style.display = 'none'; $('.toolmenu').css('display', 'none');
     </script><p style='color:green'>".$msg."</p>";
   }
         
        }      

//=================================================================================================//
                                       